@import './variables';


@each $colorKey,
$color in $colors {
    .text-#{$colorKey} {
        color: $color;
    }

    .bg-#{$colorKey} {
        background-color: $color;
    }

    .bc-#{$colorKey} {
        border-color: $color;
    }
}

// text align
@each $var in (left, center, right) {
    .text-#{$var} {
        text-align: $var !important;
    }
}

@each $sizeKey,
$size in $font-sizes {
    .fs-#{$sizeKey} {
        font-size: $size;
    }
}

@each $key,
$value in $flex-jc {
    .jc-#{$key} {
        justify-content: $value;
    }
}

@each $key,
$value in $flex-ai {
    .ai-#{$key} {
        align-items: $value;
    }
}

// m-0, mx-0
@each $typeKey,
$type in $spacing-types {

    // .m-1
    @each $sizeKey,
    $size in $spacing-sizes {
        .#{$typeKey}-#{$sizeKey} {
            #{$type}: $size * $spacing-base-size;
        }
    }

    // .mx-1 , .my-1
    @each $sizeKey,
    $size in $spacing-sizes {
        .#{$typeKey}x-#{$sizeKey} {
            #{$type}-left: $size * $spacing-base-size;
            #{$type}-right: $size * $spacing-base-size;
        }

        .#{$typeKey}y-#{$sizeKey} {
            #{$type}-top: $size * $spacing-base-size;
            #{$type}-bottom: $size * $spacing-base-size;
        }
    }

    // .mt-1
    @each $directionKey,
    $direction in $spacing-directions {

        @each $sizeKey,
        $size in $spacing-sizes {
            .#{$typeKey}#{$directionKey}-#{$sizeKey} {
                #{$type}-#{$direction}: $size * $spacing-base-size;
            }
        }
    }
}

@mixin wh($width, $height) {
    width: #{$width};
    height: #{$height};
}


// 多行省略号
@mixin text-overflow($line) {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    display: -moz-box;
    -webkit-line-clamp: #{$line}; // 控制多行的行数
    -moz-line-clamp: #{$line}; // 控制多行的行数
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
}



@mixin active-btn($w, $h) {
    display: flex;
    justify-content: center;
    align-items: center;
    width: $w;
    height: $h;
    margin: 0 auto;
    font-size: 34rpx;
    color: #fff;
    font-weight: bolder;
    background: linear-gradient(54deg, rgba(123, 211, 139, 1) 0%, rgba(58, 189, 84, 1) 100%);
    border-radius: 50rpx;

}